﻿using System;
using System.Collections.ObjectModel;
using VisualWip.Core.Interfaces;

namespace VisualWip.Core.SlotsProviders
{
    public class SlotsProvider : ISlotsProvider
    {
        private readonly bool _availableSlots;

        public SlotsProvider(bool availableSlots)
        {
            _availableSlots = availableSlots;
        }

        #region ISlotsProvider Members

        public virtual Collection<Slot> GetSlots(int workInProgressLimit, int workInProgressCount)
        {
            var slots = new Collection<Slot>();

            for (int workPosition = 0; workPosition < Math.Max( workInProgressLimit,workInProgressCount); workPosition++)
            {
                slots.Add(new Slot(workInProgressLimit,workPosition,_availableSlots));
            }
 
            return slots;
        }

        #endregion

     }
}